home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19990725-20000114 / 000249_news@columbia.edu _Sat Oct 30 15:58:51 1999.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA01538
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Sat, 30 Oct 1999 15:58:50 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id PAA28506
  7.     for kermit.misc@watsun.cc.columbia.edu; Sat, 30 Oct 1999 15:33:35 -0400 (EDT)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Subject: Re: Q: can kermit interface with other programs ?
  11. Date: 30 Oct 1999 19:33:34 GMT
  12. Organization: Columbia University
  13. Message-ID: <7vfh6e$rql$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@columbia.edu
  15.  
  16. In article <7vdj78$nu6$1@nnrp1.deja.com>,  <tilmanglotzner@my-deja.com> wrote:
  17. : Can kermit read the exit codes of programs it kicks off ?
  18. :
  19. It depends on which Kermit program and version, on which operating system.
  20.  
  21. : I am doing a download with kermit, and I want a perl program to do some
  22. : post processing on that. The perl program is kicked of from kermit, and
  23. : currently kermit gets the status of the perl program by flag files.
  24. : Interfacing with exit codes would be more elegant.
  25. If this is some form of UNIX, then C-Kermit 7.0 can do this:
  26.  
  27.   http://www.columbia.edu/kermit/ck70.html
  28.  
  29. Example: Here is a file 'foo' that contains three lines:
  30.  
  31.   $ cat foo
  32.   abc
  33.   mno
  34.   xyz
  35.   $
  36.  
  37. Running grep from Kermit for a line that is in the file succeeds:
  38.  
  39.   $ kermit
  40.   C-Kermit>define xx !grep \%1 foo, status, show var pexitstat
  41.   C-Kermit>xx abc
  42.   abc
  43.    SUCCESS
  44.    \v(pexitstat) = 0
  45.   C-Kermit>
  46.  
  47. And doing the same for a line that isn't there fails:
  48.  
  49.   C-Kermit>xx blah
  50.    FAILURE
  51.    \v(pexitstat) = 1
  52.   C-Kermit>
  53.  
  54. Thus IF SUCCESS or IF FAILURE can be used to test the success or failure
  55. reported by the external command, and the variable \v(pexitstat) contains
  56. its actual exit status code.
  57.  
  58. This didn't work very well in earlier C-Kermit releases.
  59.  
  60. - Frank